﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
//
public class Example1 : MonoBehaviour
{

    public string prefabRef;
    public string NPCRef;
    private void Start()
    {
        
    }
    private void OnGUI()
    {
        if (GUILayout.Button("Prefab 实例化"))
        {
            Addressables.InstantiateAsync(prefabRef).Completed += e =>
            {
                Debug.LogError("实例化：" + e.Result.name);
            };
        }
        if (GUILayout.Button("NPC 实例化"))
        {
            Addressables.InstantiateAsync(NPCRef).Completed += e =>
            {
                Debug.LogError("实例化：" + e.Result.name);
            };
        }

        
        
    }

}
